<?php

class Application_Model_ProductBrowse
{
	protected $_product_browse_id;
	protected $_product_buy_id;
	protected $_amount;
    protected $_creation_time;

    public function __construct(array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function __set($name, $value)
    {
        $method = 'set' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid product_browse property');
        }
        $this->$method($value);
    }

    public function __get($name)
    {
        $method = 'get' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid product_browse property');
        }
        return $this->$method();
    }

    public function setOptions(array $options)
    {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }

    public function setProduct_browse_id($id)
    {
        $this->_product_browse_id = (int) $id;
        return $this;
    }

    public function getProduct_browse_id()
    {
        return $this->_product_browse_id;
    }
    
	public function setProduct_buy_id($id)
    {
        $this->_product_buy_id = (string) $id;
        return $this;
    }

    public function getProduct_buy_id()
    {
        return $this->_product_buy_id;
    }
    
	public function setAmount($amount)
    {
        $this->_amount = (int) $amount;
        return $this;
    }

    public function getAmount()
    {
        return $this->_amount;
    }
    
	public function setCreation_time($text)
    {
        $this->_creation_time =  $text;
        return $this;
    }

    public function getCreation_time()
    {
        return $this->_creation_time;
    }
}

